package megamek.unit.tests;

import org.junit.*;

import megamek.common.IGame;
import megamek.common.Aero;
import megamek.common.QuadMech;
import megamek.common.VTOL;
import megamek.common.BipedMech;
import megamek.common.Targetable;
import megamek.common.ToHitData;
import megamek.common.Pilot;
import megamek.common.Game;
import megamek.common.Entity;
import static org.junit.Assert.*;

/**
 * The class <code>PunchAttackActionTest</code> contains tests for the class <code>{@link PunchAttackAction}</code>.
 *
 * @generatedBy CodePro at 5/20/14 11:53 AM
 * @author Wraith
 * @version $Revision: 1.0 $
 */
public class PunchAttackActionTest {
	/**
	 * Run the PunchAttackAction(int,int,int) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testPunchAttackAction_1()
		throws Exception {
		int entityId = 1;
		int targetId = 1;
		int arm = 1;

		PunchAttackAction result = new PunchAttackAction(entityId, targetId, arm);

		// add additional test code here
		assertNotNull(result);
		assertEquals(1, result.getArm());
		assertEquals(0, result.getTargetType());
		assertEquals(1, result.getTargetId());
		assertEquals(1, result.getEntityId());
	}

	/**
	 * Run the PunchAttackAction(int,int,int,int,boolean,boolean) constructor test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testPunchAttackAction_2()
		throws Exception {
		int entityId = 1;
		int targetType = 1;
		int targetId = 1;
		int arm = 1;
		boolean leftBlade = true;
		boolean rightBlade = true;

		PunchAttackAction result = new PunchAttackAction(entityId, targetType, targetId, arm, leftBlade, rightBlade);

		// add additional test code here
		assertNotNull(result);
		assertEquals(1, result.getArm());
		assertEquals(1, result.getTargetType());
		assertEquals(1, result.getTargetId());
		assertEquals(1, result.getEntityId());
	}

	/**
	 * Run the int getArm() method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testGetArm_1()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, true, true);

		int result = fixture.getArm();

		// add additional test code here
		assertEquals(1, result);
	}

	/**
	 * Run the int getDamageFor(Entity,int,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testGetDamageFor_1()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.heat = 9;
		entity.crew = new Pilot();
		int arm = 1;
		boolean targetInfantry = true;

		int result = PunchAttackAction.getDamageFor(entity, arm, targetInfantry);

		// add additional test code here
		assertEquals(1, result);
	}

	/**
	 * Run the int getDamageFor(Entity,int,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testGetDamageFor_2()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.heat = 1;
		entity.crew = new Pilot();
		int arm = 1;
		boolean targetInfantry = false;

		int result = PunchAttackAction.getDamageFor(entity, arm, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the int getDamageFor(Entity,int,boolean) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testGetDamageFor_3()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.heat = 9;
		entity.crew = new Pilot();
		int arm = 2;
		boolean targetInfantry = false;

		int result = PunchAttackAction.getDamageFor(entity, arm, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}
	
	@Test
	public void testGetDamageFor_4                                           ()
		throws Exception {
		BipedMech entity = new BipedMech();
		entity.heat = 9;
		entity.crew = new Pilot();
		int arm = 1;
		boolean targetInfantry = false;

		int result = PunchAttackAction.getDamageFor(entity, arm, targetInfantry);

		// add additional test code here
		assertEquals(0, result);
	}

	/**
	 * Run the boolean isBladeExtended(int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testIsBladeExtended_1()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, true, true);
		int arm = 1;

		boolean result = fixture.isBladeExtended(arm);

		// add additional test code here
		assertEquals(true, result);
	}

	/**
	 * Run the boolean isBladeExtended(int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testIsBladeExtended_2()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, false, true);
		int arm = 1;

		boolean result = fixture.isBladeExtended(arm);

		// add additional test code here
		assertEquals(false, result);
	}

	/**
	 * Run the boolean isBladeExtended(int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testIsBladeExtended_3()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, true, true);
		int arm = 2;

		boolean result = fixture.isBladeExtended(arm);

		// add additional test code here
		assertEquals(true, result);
	}

	/**
	 * Run the boolean isBladeExtended(int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testIsBladeExtended_4()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, true, true);
		int arm = 3;

		boolean result = fixture.isBladeExtended(arm);

		// add additional test code here
		assertEquals(false, result);
	}

	/**
	 * Run the boolean isBladeExtended(int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testIsBladeExtended_5()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, true, false);
		int arm = 2;

		boolean result = fixture.isBladeExtended(arm);

		// add additional test code here
		assertEquals(false, result);
	}

	/**
	 * Run the void setArm(int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testSetArm_1()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, true, true);
		int arm = 1;

		fixture.setArm(arm);

		// add additional test code here
	}

	/**
	 * Run the ToHitData toHit(IGame) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_1()
		throws Exception {
		PunchAttackAction fixture = new PunchAttackAction(1, 1, 1, 1, true, true);
		IGame game = new Game();

		ToHitData result = fixture.toHit(game);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.NullPointerException
		//       at megamek.common.HexTarget.<init>(HexTarget.java:29)
		//       at megamek.common.Game.getTarget(Game.java:1121)
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:113)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_2()
		throws Exception {
		IGame game = new Game();
		int attackerId = 9;
		Targetable target = new Aero();
		int arm = 1;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.IllegalArgumentException: Attacker or target not valid
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:209)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_3()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = new Aero();
		int arm = 1;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.IllegalArgumentException: Attacker or target not valid
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:209)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_4()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = new Aero();
		int arm = 1;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.IllegalArgumentException: Attacker or target not valid
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:209)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_5()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = new Aero();
		int arm = 1;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.IllegalArgumentException: Attacker or target not valid
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:209)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_6()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = new Aero();
		int arm = 2;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.IllegalArgumentException: Attacker or target not valid
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:209)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_7()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = new Aero();
		int arm = 1;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.IllegalArgumentException: Attacker or target not valid
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:209)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHit_8()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = new Aero();
		int arm = 2;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		// An unexpected exception was thrown in user code while executing this test:
		//    java.lang.IllegalArgumentException: Attacker or target not valid
		//       at megamek.common.actions.PunchAttackAction.toHit(PunchAttackAction.java:209)
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test(expected = java.lang.IllegalArgumentException.class)
	public void testToHit_9()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = null;
		int arm = 1;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the ToHitData toHit(IGame,int,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test(expected = java.lang.IllegalArgumentException.class)
	public void testToHit_10()
		throws Exception {
		IGame game = new Game();
		int attackerId = 1;
		Targetable target = new Aero();
		int arm = 3;

		ToHitData result = PunchAttackAction.toHit(game, attackerId, target, arm);

		// add additional test code here
		assertNotNull(result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_1()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new Aero();
		Targetable target = new Aero();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_3()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new Aero();
		int arm = 2;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_4()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new Aero();
		int arm = 2;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_5()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new Aero();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_6()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new Aero();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_7()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new Aero();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_8()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new Aero();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_9()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new VTOL();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_10()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new VTOL();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_11()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new VTOL();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_12()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new Aero();
		int arm = 1;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Run the String toHitIsImpossible(IGame,Entity,Targetable,int) method test.
	 *
	 * @throws Exception
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Test
	public void testToHitIsImpossible_13()
		throws Exception {
		IGame game = new Game();
		Entity aEntity = new BipedMech();
		Targetable target = new VTOL();
		int arm = 2;

		String result = PunchAttackAction.toHitIsImpossible(game, aEntity, target, arm);

		// add additional test code here
		assertEquals("A friendly unit can never be the target of a direct attack.", result);
	}

	/**
	 * Perform pre-test initialization.
	 *
	 * @throws Exception
	 *         if the initialization fails for some reason
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@Before
	public void setUp()
		throws Exception {
		// add additional set up code here
	}

	/**
	 * Perform post-test clean-up.
	 *
	 * @throws Exception
	 *         if the clean-up fails for some reason
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	@After
	public void tearDown()
		throws Exception {
		// Add additional tear down code here
	}

	/**
	 * Launch the test.
	 *
	 * @param args the command line arguments
	 *
	 * @generatedBy CodePro at 5/20/14 11:53 AM
	 */
	public static void main(String[] args) {
		new org.junit.runner.JUnitCore().run(PunchAttackActionTest.class);
	}
}